Skip to content

Add bot detection commands#1435

Open
bkiran6398 wants to merge 12 commits intomainfrom
DXCDT-1069/add_bot_detection
Open

Add bot detection commands#1435
bkiran6398 wants to merge 12 commits intomainfrom
DXCDT-1069/add_bot_detection

Conversation

@bkiran6398
Copy link
Contributor

@bkiran6398 bkiran6398 commented Feb 11, 2026

🔧 Changes

Adds bot detection management commands to the Auth0 CLI, allowing users to view and configure bot detection settings directly from the command line.

New Commands:

  • auth0 protection bot-detection show - Display current bot detection settings
  • auth0 protection bot-detection update - Update bot detection settings

Technical Updates:

  • Use go-auth0 v2 API for bot detection operations

📚 References

🔬 Testing

Automated Tests:

  • Unit tests for utility functions (stringPtr)
  • Integration test cases in test/integration/attack-protection-test-cases.yaml

Manual Testing:

  • Displayed current bot detection settings
  • Updated bot detection settings in both interactive and non-interactive modes

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

…etection branch commit

- Updated the go-auth0 dependency from v1.33.0 to v1.33.1-0.20260211120643-ac1cfcb90495.
- This change ensures compatibility with the latest features and fixes provided by the go-auth0 library.
- Introduced new commands for managing bot detection settings, including:
  - `bot-detection show`: Displays current bot detection settings.
  - `bot-detection update`: Updates bot detection settings with user-defined parameters.
- Added `GetBotDetection` and `UpdateBotDetection` methods to the AttackProtectionAPI interface for retrieving and updating settings.
- Implemented a new `botDetectionView` struct for rendering bot detection settings in the CLI.
- Enhanced the attack protection command structure to include bot detection management.
- Introduced new test cases for bot detection functionality.
- Added tests for both showing and updating bot detection settings.
- Ensured that the output contains relevant fields.
- These changes enhance the coverage of the attack protection feature.
…ated file

- Created a new YAML file for integration test cases specifically for
  attack protection features, including bot detection.
- Moved existing test cases related to attack protection from
  `test-cases.yaml` to `attack-protection-test-cases.yaml` for better
  organization and clarity.
- Each test case verifies the expected output and exit codes for
  various attack protection commands, ensuring functionality and
  reliability of the bot detection feature.
- Updated `auth0_protection.md` to include a link to the new bot detection management commands.
- Created `auth0_protection_bot-detection.md` to describe bot detection features and settings.
- Added `auth0_protection_bot-detection_show.md` for displaying current bot detection settings.
- Added `auth0_protection_bot-detection_update.md` for updating bot detection settings.
@bkiran6398 bkiran6398 marked this pull request as ready for review February 12, 2026 08:51
@bkiran6398 bkiran6398 requested a review from a team as a code owner February 12, 2026 08:51
bkiran6398 and others added 7 commits February 13, 2026 15:59
- Introduced a new function `initializeManagementClientV2` to create a management client using the v2 API.
- This function utilizes the `github.com/auth0/go-auth0/v2` package for improved management capabilities.
- Updated `go.mod` and `go.sum` to include the v2 dependency.
- Added support for v2 management client in the attack protection module.
- Added the AttackProtectionBotDetectionAPIV2 interface to use v2 types.
- Refactored bot detection show command to utilize new v2 API methods.
- Adjusted display functions to handle v2 bot detection response types.
- Enhanced the CLI to initialize and use the v2 management client.
…h0-v2

- Updated the `updateBotDetectionCmdRun` function to utilize the new go-auth0 v2 for bot detection settings.
- Introduced a new `stringPtr` utility function to handle string-derived pointer conversions.
- Added tests for `stringPtr` to ensure correct behavior with nil and custom string types.
- Refactored rendering functions to accommodate changes in the bot detection settings response structure.
- Improved user prompts for bot detection configuration options.
- Updated go-auth0 dependency from v1.33.1 to v1.33.0 in go.mod and go.sum
- Renamed variable `bd` to `current` for clarity in the `updateBotDetectionCmdRun` function.
- Removed the `noInputValueFlagSet` function and its associated logic to streamline command behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant